From: Georges Basile Stavracas Neto Date: Fri, 1 Jan 2021 16:10:19 +0000 (-0300) Subject: workspacesView: Derive workspace state from fit mode X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~479 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1adcbaab46c879228ad8b34392b82f317d15cfde;p=gnome-shell.git workspacesView: Derive workspace state from fit mode Derive the workspace state WorkspacesView's workspaces from the fit mode. Extra workspaces still run the zoom animations as before. Part-of: --- diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 38218fc9b..b37a7e39e 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -1341,4 +1341,8 @@ class Workspace extends St.Widget { return false; } + + get stateAdjustment() { + return this.layout_manager.stateAdjustment; + } }); diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index ab8c78c5f..7f8fb04de 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -217,9 +217,12 @@ class WorkspacesView extends WorkspacesViewBase { _updateWorkspacesState() { const adj = this._scrollAdjustment; + const fitMode = this._fitModeAdjustment.value; // Fade and scale inactive workspaces this._workspaces.forEach((w, index) => { + w.stateAdjustment.value = Util.lerp(1, 0, fitMode); + const distanceToCurrentWorkspace = Math.abs(adj.value - index); const progress = 1 - Math.clamp(distanceToCurrentWorkspace, 0, 1); @@ -290,14 +293,12 @@ class WorkspacesView extends WorkspacesViewBase { } animateToOverview() { - for (let w = 0; w < this._workspaces.length; w++) - this._workspaces[w].zoomToOverview(); this._updateVisibility(); } animateFromOverview() { for (let w = 0; w < this._workspaces.length; w++) - this._workspaces[w].zoomFromOverview(); + this._workspaces[w].prepareToLeaveOverview(); } syncStacking(stackIndices) {